package com.chengzhi.controller;

import com.chengzhi.service.AccountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @author: ruanchengzhi
 * @create: 2020-06-23 08:59
 **/
@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    @GetMapping("/debit/{userId}/{money}")
    public Boolean debit(@PathVariable("userId") String userId, @PathVariable("money") Integer money) {
        accountService.debit(userId, money);
        return true;
    }
}